<?php
/**
 * Created by PhpStorm.
 * User: aron
 * Date: 2019/5/20
 * Time: 5:44 PM
 */

include_once "../../Util/DebugUtil/DebugUtil.php";


$fileName = "../16.2-dir-operation/DirOperation.php";
$fileName = "./testfile.txt";


DebugUtil::printDebugSeperator("fread");
$fileHandle = fopen($fileName, "r");
$readString = fread($fileHandle, 1);
fclose($fileHandle);
echo "\$readString = ";
yt_debug_print_break_line_for_ascii();
echo  $readString;
yt_debug_print_break_line();



DebugUtil::printDebugSeperator("file_get_contents");
$readString = file_get_contents($fileName);
echo "\$readString = ";
yt_debug_print_break_line_for_ascii();
echo  $readString;
yt_debug_print_break_line();



DebugUtil::printDebugSeperator("fgets");
$fileHandle = fopen($fileName, "r");
$readString = fgets($fileHandle);
fclose($fileHandle);
echo "\$readString = ";
yt_debug_print_break_line_for_ascii();
echo  $readString;
yt_debug_print_break_line();



DebugUtil::printDebugSeperator("fgetc");
$fileHandle = fopen($fileName, "r");
$readString = fgetc($fileHandle);
fclose($fileHandle);
echo "\$readString = ";
yt_debug_print_break_line_for_ascii();
echo  $readString;
yt_debug_print_break_line();



DebugUtil::printDebugSeperator("readfile");
$readString = readfile($fileName);
echo "\$readString = ";
yt_debug_print_break_line_for_ascii();
echo  $readString;
yt_debug_print_break_line();




